using UnityEngine;

public class ArrayHideGameObjectOnButton : MonoBehaviour
{
	[SerializeField]
	private GameObject[] arrayHideGameObject;

	private int index;

	private static int movingButton;

	private int indexForButton;

	private void Awake()
	{
		indexForButton = movingButton;
		movingButton++;
	}

	private void OnGUI()
	{
		GUILayout.Space(300f);
		if (GUILayout.Button("HIDE OBJECT", GUILayout.Height(50f), GUILayout.Width(300f)) && index < arrayHideGameObject.Length - 1)
		{
			arrayHideGameObject[index].SetActive(false);
			index++;
		}
	}
}
